package com.waiter.agent;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageButton;

public class MainActivity extends Activity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		ImageButton orderBill = (ImageButton) findViewById(R.id.button1);
		ImageButton menu = (ImageButton) findViewById(R.id.button2);
		ImageButton history = (ImageButton) findViewById(R.id.button3);
		ImageButton help = (ImageButton) findViewById(R.id.button4);
		orderBill.setOnClickListener(ButtonListener());
		menu.setOnClickListener(ButtonListener());
		history.setOnClickListener(ButtonListener());
		help.setOnClickListener(ButtonListener());
	}

	public OnClickListener ButtonListener() {
		return new OnClickListener() {
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent i;

				int id = v.getId();
				switch (id) {
				case R.id.button1: {
					i = new Intent(getApplicationContext(),
							OrderBillActivity.class);
					startActivity(i);
					break;
				}

				case R.id.button2: {
					i = new Intent(getApplicationContext(),
							ChooseFoodActivity.class);
					startActivity(i);
					break;
				}
				case R.id.button3: {
					i = new Intent(getApplicationContext(),
							TableListActivity.class);
					startActivity(i);
					break;
				}

				case R.id.button4: {
					
					break;
				}
				}

			}

		};
	}
}